/** # 系统角色 */
const Struct = {};

/** # 角色名称 */
Struct['name'] = {
  title: '名称',
  dataIndex: 'name',
  itemProps: { rules: [{ required: true, message: '此项必填' }] },
  width: 'e8',
  render: ['text'],
  event: { click: 'profile' },
  listRender: { as: 'name' },
};

/** # 角色标识 */
Struct['key'] = {
  title: '标识',
  dataIndex: 'key',
  itemProps: { rules: [{ required: true, message: '此项必填' }] },
  width: 'e8',
  render: ['text'],
  listRender: { as: 'title', className: 'column-2' },
};

/** # 角色状态 */
Struct['enable'] = {
  extend: 'SelectDict',
  extendProps: 'CommonStatus',
  title: '状态',
  dataIndex: 'enable',
  itemProps: { rules: [{ required: true, message: '此项必填' }] },
  listRender: { as: 'item', className: 'column-2' },
};

/** # 角色备注 */
Struct['remark'] = {
  title: '备注',
  dataIndex: 'remark',
  width: 'e16',
  render: ['text'],
  visible: (type) => type !== 'search',
  listRender: { as: 'description' },
};

/** # 新增时间 */
Struct['createTime'] = {
  title: '新增时间',
  dataIndex: 'createTime',
  width: 'e12',
  render: ['text'],
  listRender: { as: 'extra' },
  visible: ['list', 'profile'],
};

/** # 更新时间 */
Struct['updateTime'] = {
  title: '更新时间',
  dataIndex: 'updateTime',
  width: 'e12',
  render: ['text'],
  listRender: { as: 'extra' },
  visible: ['list', 'profile'],
};

export default Struct;
